﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace _1stWpfPractice
{
    public class Staff : INotifyPropertyChanged
    {
        private string _name;
        private int _age;
        private StaffType _staffType;

        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;
                NotifyPropertyChanged("Name");
            }
        }

        public virtual int Age
        {
            get { return _age; }
            set
            {
                _age = value;
                NotifyPropertyChanged("Age");
            }
        }

        public StaffType StaffType { get { return _staffType; } }
        public string Type { get { return _staffType.ToString(); } }

        public Staff(string name, int age, StaffType staffType)
        {
            this._name = name;
            this._age = age;
            this._staffType = staffType;
        }

        public Staff()
        {
 
        }


        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
}
